package com.game.tiledmap;

import android.graphics.Color;

import com.game.framwork.itf.Graphics;

public class DamgeReceive {
	public int dame;
	public int x;
	public int y;
	public boolean isActive;

	private float time;
	private TiledMap tiledMap;

	public DamgeReceive(int dame, int x, int y, TiledMap tiledMap) {
		this.dame = dame;
		this.x = x;
		this.y = y;
		this.tiledMap = tiledMap;
		isActive = true;
	}

	public void update(float deltaTime) {
		time += deltaTime;
		if (time > 1.0f) {
			isActive = false;
			time = 0;
		}
	}

	public void paint(Graphics g) {
		if (isActive) {
			g.drawText(dame + "", x + tiledMap.getCamera().getCameraX(), y
					+ tiledMap.getCamera().getCameraY(), Color.RED, 30);
		}
	}

}
